/*
* ============================================================================
*  Name        : camengtestappui.h
*  Part of     : camengtest
*  Description : 
*  Version     : %version: 2 %
*
* This program is free software. It comes without any warranty, to
* the extent permitted by applicable law. You can redistribute it
* and/or modify it under the terms of the Do What The Fuck You Want
* To Public License, Version 2, as published by Sam Hocevar. See
* http://sam.zoy.org/wtfpl/COPYING for more details.
*
* You are welcome to, but not required to, contribute any modifications that
* improve stability, usability and/or feature set of the library back to
* Symbian/S60 Camera Wrapper project, as long as binary compatibility is
* retained. See https://projects.forum.nokia.com/camerawrapper for more info.
* ============================================================================
*/

#ifndef __CAMENGTESTAPPUI_H__
#define __CAMENGTESTAPPUI_H__

// INCLUDES
#include <aknappui.h>
#include "cameraengineobserver.h"

// FORWARD DECLARATIONS
class CCAMENGTESTAppView;
class CCameraEngine;


// CLASS DECLARATION
/**
* CCAMENGTESTAppUi application UI class.
* Interacts with the user through the UI and request message processing
* from the handler class
*/
class CCAMENGTESTAppUi : public CAknAppUi, public MCameraEngineObserver
    {
    public: // Constructors and destructor

        /**
        * ConstructL.
        * 2nd phase constructor.
        */
        void ConstructL();

        /**
        * CCAMENGTESTAppUi.
        * C++ default constructor. This needs to be public due to
        * the way the framework constructs the AppUi
        */
        CCAMENGTESTAppUi();

        /**
        * ~CCAMENGTESTAppUi.
        * Virtual Destructor.
        */
        virtual ~CCAMENGTESTAppUi();

    private:  // Functions from base classes    
    
        TKeyResponse HandleKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );

        /**
        * From CEikAppUi, HandleCommandL.
        * Takes care of command handling.
        * @param aCommand Command to be handled.
        */
        void HandleCommandL( TInt aCommand );

        /**
        * HandleResourceChangeL()
        * Called by framework when layout is changed.
        * @param aType the type of resources that have changed
        */
        void HandleResourceChangeL( TInt aType );
        
        // from MCameraEngineObserver
        void MceoCameraReady();
        void MceoFocusComplete();
        void MceoCapturedDataReady( TDesC8* aData );
        void MceoCapturedBitmapReady( CFbsBitmap* aBitmap );
        void MceoViewFinderFrameReady( CFbsBitmap& aFrame );
        void MceoHandleError( TCameraEngineError aErrorType, TInt aError );
        void MceoHandleOtherEvent( const TECAMEvent& aEvent );

    private: // Data

        /**
        * The application view
        * Owned by CCAMENGTESTAppUi
        */
        CCAMENGTESTAppView*   iAppView;
        CCameraEngine*        iEng;
        
        TBool                 iUsingVF;
        TSize                 iVfSize;
        TSize                 iImgSize;
        
        TInt                  iExposure;
        TInt                  iFlash;
        TBool                 iDoFocus;
    };

#endif // __CAMENGTESTAPPUI_H__

// End of File
